<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>插槽</title>
    <script src="../../js/common/vue/vue.js"></script>
</head>
<body>
<div id="app">
    <h2>{{message}}</h2>
    <cpn></cpn>
    <cpn>
        <button>我是通过插槽自定义的按钮</button>
    </cpn>
    <cpn><h2>插槽就是一个占位符</h2></cpn>
</div>
<template id="cpn">
    <div>
        <h2>我是组件</h2>
        <slot>
            <button>我是默认按钮</button>
        </slot>
    </div>
</template>
<script>
    new Vue({
        el: '#app',
        data: {
            message: 'vue实例'
        },
        components:{
            cpn:{
                template:'#cpn'
            }
        }
    })
</script>
</body>
</html>